package com.violet.java;

import com.violet.bean.Customer;
import sun.security.provider.PolicySpiFile;

import java.util.ArrayList;

/**
 * @author shkstart
 * @date 2022/3/22 - 20:26
 */
public class Templates   {

    //模板6：prsf，可生成 private static final
    private static final Customer cust = new Customer();

    //变形：psf
    public static final int NUM = 1;
    //变形：psfi
    public static final int NUM2 = 2;
    //变形：psfs
    public static final String  NAATION = "china";



    //模板1 psvm
    public static void main(String[] args) {

        //模板2 sout：
        System.out.println("Violet");
        //变形：soutp / soutm / soutv / xxx.sout
        System.out.println("args = [" + args + "]");
        System.out.println("Templates.main");
        int num1 = 10;
        System.out.println("num1 = " + num1);
        int num2 = 20;
        System.out.println("num2 = " + num2);
        System.out.println(num1);
        //模板3 fori
        String[] arr = new String[]{"Tom","Jeery","JAY","HanMeimei"};
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
        //变形：iter
        for (String s : arr) {
            System.out.println(s);
        }
        //变形：itar
        for (int i = 0; i < arr.length; i++) {
            String s = arr[i];
            System.out.println(s);
        }
        //模板4：list.for
        ArrayList list = new ArrayList();
          list.add(123);
          list.add(456);
          list.add(789);

        for (Object o : list) {

        }
        //变形:list.fori
        for (int i = 0; i <; i++) {
            
        }

         //变形：list.forr
        for (int i = list.size() - 1; i >= 0; i--) {
            
        }

    }

    public void method() {
        System.out.println("Templates.method");
        ArrayList list = new ArrayList();
        list.add(123);
        list.add(456);
        list.add(789);
        //模型5：ifn
        if (list == null) {

        }
        //变形
        if (list != null) {

        }
        //变形：xxx.nn / xxx.null
        if (list == null) {

        }
        if (list != null) {

        }

    }

}
